package org.diysearch.dao.interfaces;

import java.sql.SQLException;
import java.util.List;

import org.diysearch.models.Category;

public interface CategoryDao {
	public int save(Category c) throws SQLException;
	public int save(List<Category> categories) throws SQLException;
	
	/**
	 * Get children categories, by providing a parent ID. If a parent ID
	 * is 0, then this will return all categories. 
	 * @param parentId
	 * @return
	 * @throws SQLException
	 */
	public List<Category> findByParent(int parentId) throws SQLException;
	public Category findById (int id) throws SQLException;
	public Category findByName (String name) throws SQLException;
	
	public int delete(Category c) throws SQLException;
	public int delete(List<Category> categories) throws SQLException;
	
}
